# Filenames
EXECUTABLE = trifecta

# C++ compiler
CXX = g++

# Compile flags
CXXFLAGS = -Wall -W -g -c \
           `pkg-config --cflags taglib` \
           `pkg-config --cflags gtkmm-2.4`

# Linker flags
LDFLAGS = `pkg-config --libs taglib` \
          `pkg-config --libs gtkmm-2.4`

# Source files
SOURCES = src/main.cpp \
          src/library/Library.cpp \
          src/library/LibraryBuilder.cpp \
          src/library/Song.cpp \
          src/library/Album.cpp \
          src/library/Artist.cpp \
          src/player/Player.cpp \
          src/player/GstPlayer.cpp \
          src/gui/MainWindow.cpp

# Header files
HEADERS = src/library/Library.h \
          src/library/LibraryBuilder.h \
          src/library/Song.h \
          src/library/Album.h \
          src/library/Artist.h \
          src/player/Player.h \
          src/player/GstPlayer.h \
          src/gui/MainWindow.h

# Object files (from names of source files)
OBJS = $(SOURCES:.cpp=.o)

###
# Targets
###

all: $(SOURCES) $(HEADERS) $(EXECUTABLE)

$(EXECUTABLE): $(OBJS)
	$(CXX) $(LDFLAGS) $(OBJS) -o $@
	
.cc.o:
	$(CXX) $(CXXFLAGS) $< -o $@

clean:
	-rm -f src/*.o src/*/*.o $(EXECUTABLE)
